use crate::service::model::store::{BaseBean, BaseDataBean};
use serde::Serialize;

pub fn error_json(status:u16, msg:&str) ->String{
    serde_json::to_string(&BaseBean{status,msg:msg.to_string()}).unwrap()
}
pub fn success_json() ->String{
    serde_json::to_string(&BaseBean{status:200,msg:"成功".to_string()}).unwrap()
}
pub fn success_json_data<T:Serialize>(data:T) ->String{
    serde_json::to_string(&BaseDataBean{status:200,msg:"成功".to_string(),data}).unwrap()
}